﻿using System;
using System.Collections.Generic;
using System.Text;
using SwinGame;

namespace SurvivalNN.src
{
    class PlayerPropController : PropController
    {
        public PlayerPropController(IEntitySubModel model) : base(model) { }
        public void PollInput(float dt)
        {
            //dt *= 100;  //scale
            int dx = 0;
            int dy = 0;
            if (Input.KeyDown(KeyCode.vk_LEFT)) { dx--; }
            if (Input.KeyDown(KeyCode.vk_RIGHT)) { dx++; }
            if (Input.KeyDown(KeyCode.vk_UP)) { dy--; }
            if (Input.KeyDown(KeyCode.vk_DOWN)) { dy++; }
            Vector v = new Vector{X = dx,Y= dy};
            v = v.UnitVector;
            v.X *= dt; v.Y *= dt;
            base.MovePropAction(true, v);
        }
    }
}
